<?php if (!$ajax) { ?><div id="event_list"><?php } ?>
<h4>
<?php if ($visitor) {
$address = $visitor['address'];
if (strpos($address, ',')) {
    $address = substr($address, 0, strpos($address, ','));
}
?>
Events near <?php echo htmlentities($address); ?>
<?php } else { ?>
Event on the Internet
<?php } ?>
 (<a class="more-link" href="#" onclick="javascript: document.getElementById('event_location').style.display = 'block'; return false;">change</a>)
</h4>
<div id="event_location" style="display: none">
<form>
<input type="text" name="location" value="<?php echo $location; ?>" size="10">
<input type="button" value="change" onclick="vbWorldEvent_update_events(this.form.location, 'event_list');">
</form>
<br />
</div>
<?php foreach ($results as $event) { ?>
    <div class="widget widget_text">
        <strong><a class="more-link" href="<?php echo $vb_url; ?>showthread.php?t=<?php echo $event['lv_vb_eventforums_threadid']; ?>"><?php echo $event['title']; ?></a></strong><br />
        <?php echo date('M jS', $event['dateline_from']); ?>
<?php   if (isset($event['location']['url'])) { ?>
        on the <a href="<?php echo $event['location']['url']; ?>">Internet</a>
<?php   } else { ?>
        in <?php echo htmlentities($event['location']['city']); ?>, <?php echo htmlentities($event['location']['countryName']); ?> (<?php echo $event['distance']; ?>)
<?php   } ?><br />
        <span style="font-style: italic;"><?php echo htmlentities($event['summary']); ?></emphasis>
    </div>
<?php } ?>
<?php if (!$ajax) { ?></div><?php } ?>
